#!/user/bin/env node

//const msg = 'bGl1YmFuZ2xpbmc6MTIzNDU2'
//const buf = Buffer.from(msg,'base64');
//const usr_pwd = console.log(buf.toString('utf8'));

//console.log(`user name:$(user_pwd.split(":")[0]\npassword:${usr_pwd.split(':')[1]})`);



const log = console.log;
if(process.argv.length !== 3){
  log('命令行参数的格式：cmd base64_string');
  process.exit(1);
}

const buf = Buffer.from(process.argv[2],'base64');
const info = buf.toString('utf8').split(':');

if(info.length !== 2){
  console.error('信息有误');
  process.exit(2);
}

console.log("username:" + info[0] + ',password:' + info[1]);

